home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
pascal
/
tpa22.zip
/
TP&ASM.REF
< prev
next >
Wrap
Text File
|
1989-04-22
|
53KB
|
1,345 lines
TP&Asm Integrated Compile-Time Assembler Version 2.0
TP&Asm-M Memory Mode Assembly Language Development Tool Version 2.0
Copyright (c) 1989 Richard W. Prescott
All Rights Reserved
═══════ Built-In Assembly Language Support for Turbo Pascal Compilers ═══════
All brand and product names mentioned herein are trademarks or registered
trademarks of their respective holders.
┌─────────────────────────────────────────────────────────────────────┐
│ This file contains detailed reference information to enable you to │
│ make effective use of the TP&Asm assembly environment. For general │
│ information on getting started please see the file README. │
└─────────────────────────────────────────────────────────────────────┘
The following topics are described below:
1. Command Line Options
2. The Assemble Statement
3. The Asm Statement
4. The Internal Statement
5. General Assembler Syntax
6. TP&Asm-specific Options
7. Supported Mnemonics
The following additional topics are covered in the separate file
TP&ASM2.REF:
8. Error Messages
9. Trouble Shooting
1. Command Line Options
In the following discussion, "TPA(M)" is used in statements that
apply to both TPA and TPAM.
Use TPA if you have the TP&Asm Integrated Compile-Time Assembler,
and TPAM if you have the TP&Asm-M Memory Mode Assembly Development
Tool.
TP&Asm is invoked by typing one of the following lines at the DOS
prompt:
TPA(M) <full command line>
TPA(M) <abbreviation> <options>
TPA(M)
Full Command Syntax: At the DOS prompt, type
TPA(M) <full command line>
where TPA(M) refers to EITHER TPA or TPAM, and <full command line>
is any valid command line that could be executed directly from the
DOS prompt. TP&Asm will load into memory and then execute the
command line, exactly as if it had been executed by DOS. If a
supported Turbo Pascal compiler is loaded at any point during the
execution of the command line, you will see a message indicating
that the assembler is active, and assembly support will be enabled.
TP&Asm will not interfere with the operation of other non-compiler
applications.
Examples: (the following examples apply equally well to TPA and
TPAM)
TPA mybatch
run the batch file MYBATCH.BAT which changes directories and
then runs turbo. Assembly support will be enabled.
TPAM tpc myprog /r"param1 param2"
run TPC Version 4.0 to compile MYPROG.PAS and run in memory.
(Please see the Version 4.0 Owner's Handbook for information
on the /r command line option). Assembly support will be
enabled.
TPA command
load a copy of the command processor and return you to the
DOS prompt. You have just made TP&Asm "Memory resident"!
Now EACH time you run a supported compiler, you will get a
message indicating that the assembler is active, and
assembly support will be enabled. Each time you exit a
compiler, you will get a message indicating that the
assembler is inactive. Type EXIT to quit the command
processor and remove TP&Asm from memory. (You should not
run any RESIDENT programs from the command shell or you will
not be able to remove it from memory).
Abbreviated Syntax: At the DOS prompt, type one of the following:
TPA(M) c <options>
TPA(M) d <full command line>
TPA(M) c <options> is equivalent to: TPA(M) tpc <options>,
which runs the command line compiler with the specified options.
Example:
TPA c myprog (same as: TPA tpc myprog )
(Please see the Turbo Pascal Owner's Guide for available options).
TPA(M) d <full command line> will run any valid DOS command line
through debug with assembly support enabled. This is primarily of
interest to Turbo Version 4.0 users. (Requires DEBUG.COM from
your DOS disk). Examples:
TPAM d turbo (same as: TPAM debug turbo.exe )
TPA d tpc test /r (same as: TPA debug tpc.exe test /r )
NOTE: the recommended method of using any debugger with TP&Asm is to
run the debugger from TP&Asm:
TPA(M) <debugger> <parameters required by debugger>
(Please be thoroughly familiar with the proper operation of your
debugger before attempting this, since it is definitely possible to
crash your system through improper use of a debugger. Save your
work frequently, and be prepared to reboot.)
Quick Command Syntax: At the DOS prompt, type
TPA(M)
where TPA(M) refers to EITHER TPA or TPAM. TP&Asm will load into
memory and then execute TURBO.EXE, exactly as if you had typed
"turbo" at the DOS prompt. You will see a message indicating that
the assembler is active, and assembly support will be enabled.
( This is the same as executing: TPA(M) TURBO ).
2. The Assemble Statement
The syntax for the assemble statement is:
Assemble <remainder of line must be empty>
<Standard Assembly language statements>
End
Use of a semicolon ";" after the final "End" is governed by
standard Pascal statement syntax. Assembly ends with the first
"End" encountered in the mnemonic field. The entire line is then
passed on to the compiler, permitting use of an Assemble statement
in either clause of an "IF .. THEN .. ELSE" conditional statement.
The keyword "Assembly" is permitted as a synonym for "Assemble".
This is useful to avoid misleading constructions like:
IF <Pascal Condition> THEN Assemble
which gives the false impression of conditional assembly. True
conditional assembly is possible using the PAS statement described
in the section TP&Asm-specific options. Conditional execution of
an assembly block is more clearly indicated by:
IF <Pascal Condition> THEN Assembly
The Assemble statement can be used in any situation where an Inline
statement would be valid, including in the definition of (Assembly)
Inline directive/MACROs.
Examples:
{- Conditional execution of assembly code based on runtime value of x: }
IF x > 0 THEN Assembly
: <assembly statements>
End {without semicolon} ELSE Assembly
: <assembly statements>
End; {requires semicolon}
{- Define an (Assembly) Inline directive/MACRO: }
PROCEDURE ClearInterrupts;
Assemble
Cli
End; {MACRO ClearInterrupts}
{- Define a callable procedure with assembly code: }
PROCEDURE PrintScreen;
BEGIN
{- Pascal statements may be placed before ... -}
Assemble
Int 5
End; {Assemble}
{- ... or after the assembly code -}
END; {PrintScreen}
Assembly sections may be mixed freely with other Pascal statements
throughout the statement part of a block. Transfer between Pascal
and assembly sections is freely permitted:
■ A Pascal label may be specified as the target of any assembly
Call, Jmp, Loop, or conditional jump. As with the Pascal "Goto"
statement, the label must be defined in the current block.
■ An assembly label may be specified as the target of a Pascal
"Goto" statement. The target label must be declared in a
standard Pascal "Label" statement. (Assembly labels which are
referenced only within the current Assemble statement need not
be declared).
■ Pascal Procedure and Function identifiers may be specified as
the target of any assembly Call (or Jmp), or as immediate data
offsets in assembly data manipulation instructions, eg:
Mov Dx,PasProc ;load Ofs(PasProc) into Dx
The Procedure or Function must be defined in the current program
or in a Unit specified in the Uses clause. Assembly references
are fully recognized by the Turbo smart linker.
"System" Procedures and Functions do not use true PROC Calls and
therefore cannot be called from assembly language, either
directly or indirectly, except using "PAS" as described below.
■ The assembly keyword "PAS" may be used to insert single or
multiple line Pascal statements within